package com.csx.base.design.structure.proxy;

/**
 * @author cuisongxu
 * @date 2022/9/22 12:05
 */
public class Modem implements Internet{

    private final String PASSWORD = "123456";

    public Modem(String password) throws Exception {
        if(! PASSWORD.equals(password)) {
            throw new Exception("拨号失败,请重试!");
        }
        System.out.println("拨号上网...连接成功!");
    }

    @Override
    public void httpAccess(String url) {
        System.out.println("正在访问: " + url);
    }
}
